<%-- 
    Document   : seleccion
    Created on : Mar 22, 2012, 6:31:39 PM
    Author     : andreth
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<!DOCTYPE html>
<html>
    <logic:present name="matrices" >
        <tiles:insert definition="mensaje"></tiles:insert>
            <h1>Lista de Matrices </h1>
            <div id="paginador"></div><p>Muestra hasta 4 resultados </p>
            <div id="tableContainer" class="tableContainer">
                <table id="tablaDatos" border="0" cellpadding="0" cellspacing="0" width="70%" class="scrollTable">
                    <thead class="fixedHeader" id="fixedHeader">
                        <tr>
                            <th> Id</th>
                            <th> Nombre</th>
                            <th> Unidad</th>  
                            <th> Fecha Creacion </th>
                            <th> Modificar </th>
                        </tr>
                    </thead>
                    <tbody class="scrollContent">
                    <logic:iterate name="matrices" id="Matriz">
                        <tr>
                            <td>    
                                <bean:write name="Matriz" property="idMatriz"/>
                            </td>
                            <td>    
                                <bean:write name="Matriz" property="nombre"/>
                            </td>         
                            <td>  
                                <logic:present name="Matriz" property="codigoUnidad" >
                                    <bean:write name="Matriz" property="codigoUnidad" />
                                </logic:present>
                            </td>
                            <td>    
                                <bean:write name="Matriz" property="fechacreacion"/>
                            </td>
                            <td>  
                                <html:form action="/modificarMatriz?method=populate" onsubmit="return this" >
                                    <div class="buttons">
                                        <html:hidden name="Matriz" property="idMatriz"/>
                                        <button type="submit" class="regular">
                                            <img src="interfaz/images/modificar.png" alt=""/>
                                            <bean:message key="boton.modificar" />
                                        </button>
                                    </div>
                                </html:form>
                            </td>
                        </tr>
                    </logic:iterate>
                </tbody>
            </table>
        </div>
    </logic:present>       
    <script type="text/javascript">

        var p = new Paginador(
        document.getElementById('paginador'),
        document.getElementById('tablaDatos'),
        4
    );

        p.Mostrar();
    </script>
</html>